<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        function aa(){
            console.log('测试');
            var xhr = new XMLHttpRequest();
            xhr.open('get','http://127.0.0.1/ajax/tb/true.php',true);
            xhr.send(null);
            xhr.onreadystatechange = function(){
                if(this.readyState == 4){
                    console.log(JSON.parse(this.responseText)['name']);
                }
            }
        }
        aa();
    </script>
</body>
</html>